package com.devilwwj.http.exception;

/**
 * Created by devilwwj on 15/7/16.
 */
public class HttpException extends Exception{

    public int statusCode;
    public String responseMessage;

    public enum ErrorType {
        CANCEL, TIMEOUT, SERVER, JSON, IO, FILE_NOT_FOUND, UPLOAD, MANUAL
    }

    public ErrorType errorType;

    public HttpException(int status, String responseMessage) {
        super(responseMessage);
        this.errorType = ErrorType.SERVER;
        this.statusCode = status;
        this.responseMessage = responseMessage;
    }

    public HttpException(ErrorType errorType, String detailMessage) {
        super(detailMessage);
        this.errorType = errorType;
        this.responseMessage = detailMessage;
    }
}
